package chap5.Task;
public class Task7 {
    public static void main(String[] args) {
        int[] a = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 10, 9};
        int max = a[0];
        int j;
        for (int i = 0; i < a.length; i++) {
            if (max < a[i])
                max = a[i];
        }
        for (j = 0; j < a.length; j++) {
            if (max == a[j])
                break;

        }
        System.out.println("数组最大数为" + max + "，位置是" + j);
    }
}
